package bmatch.tech.todo.model;

import javax.ws.rs.core.Response;

/**
 * @program:todo
 * @author:LinJinhao
 * @create:2019-01-25 14:17
 **/
public class Result {

	//响应成功
	public static final int RESPONSE_SUCCESS = 200;

	//响应失败
	public static final int RESPONSE_FAIL = 400;

	private Object data;

	private boolean isSuccess;

	private String errorMessage;

	private int errorCode;

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setSuccess(boolean success) {
		isSuccess = success;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	@Override
	public String toString() {
		return "Response{" +
				"code=" + errorCode +
				", message='" + errorMessage + '\'' +
				", data=" + data +'\'' +
				", status=" + isSuccess +
				'}';
	}
}
